﻿function showAttachmentALink(url, container,title,className) {
    if ((url + "").length <= 0) {
        $('#' + container).html('还没有上传');
    }
    else {
        var alink = $("<a target='_blank' href='" + "../../attachments/" + url + "'>点击查看</a>");
        alink.html(title);
        alink.attr("class",className);
        alink.appendTo('#' + container);
    }
}

var dialogOptions = { modal: true, autoOpen: false, draggable: false, position: ["center", "center"], width: '600', height: '300' };

$(document).ready(function () {
    $("#attachmentDialog").dialog(dialogOptions);
    var toLookThroughBtn = $('#toLookThrough');
    var state = $('#state');
    if (toLookThroughBtn)
    {
        toLookThroughBtn.click(function () {
            state.val($('#toLookThroughValue').val())
            toLookThroughBtn.submit();
        })


    }
    var toFinancingBtn = $('#toFinancing');
    if (toFinancingBtn) {
        toFinancingBtn.click(function () {
            state.val($('#toFinancingValue').val())
            toLookThroughBtn.submit();
        });


    }
    var toCancel = $('#toCancel');
    if (toCancel) {
        toCancel.click(function () {
            state.val($('#toCancelValue').val())
            toLookThroughBtn.submit();
        });

    }

    $('#BackBtn').click(function () {

        window.location = $('#urlReferrer').val();
    });
});